<script type="text/javascript" src="/kkpager/kkpager.js"></script>
<script type="text/javascript" src="/js/adm/vb-kkpager.js"></script>
<h1 class="page_title">VB课程班级管理</h1>
<span class="btn-upload form-group">
        <input class="input-text" type="text" id="keyword"
               <#if keyword??>
                   value="${keyword!''}"
               </#if>
               style="width:200px" placeholder="prg3自测题">
        <a href="javascript:research('/adm/uploadProject/', '学生${studentId!''}上传管理');"
           class="btn btn-primary upload-btn"><i
                    class="Hui-iconfont">&#xe665;</i> 搜 索</a>
    </span>
<#if pageBean.content?size != 0>
    <table class="table table-border table-bordered table-hover mt-5"
    <thead>
    <tr>
        <th style="width: 8%;">作业名称</th>
        <th>作业类型</th>
        <th>上传时间</th>
        <th>学号</th>
        <th>评估结果</th>
        <th style="width: 40%;">说明</th>
        <th>附件</th>
        <th style="width: 10%">操 作</th>
    </tr>
    </thead>
    <tbody>
    <#list pageBean.content as bean>
        <tr>
            <td>${bean.projectName}</td>
            <td>
                <#if bean.classification == "0">
                    实例题
                <#else>
                    设计题
                </#if>
            </td>
            <td>${bean.upTime}</td>
            <td>${bean.studentNum}</td>
            <td id="result${bean.uploadId}">${bean.result}</td>
            <td>${bean.judgement}</td>
            <td><a href="/adm/project/file/?fileName=${bean.location}"><i
                            class="Hui-iconfont">&#xe695;</i>下载</a></td>
            <td>
                <input class="btn btn-warning radius" type="button" value="手动通过"
                       onclick="editUpload(this, ${bean.uploadId})">
            </td>
        </tr>
    </#list>
    <tr>
        <td colspan="8">
            <div id="kkpager"></div>
        </td>
    </tr>
    </tbody>
    <tfoot>
    </tfoot>
    </table>
<#else>
    <div class="text-c" style="height: 300px;"><h3>无记录.</h3></div>
</#if>
<script type="text/javascript">
    var studentId = null;

    <#if studentId??>
        studentId = ${studentId}
    </#if>

    function editUpload(c, uploadId) {
        var c = confirm("是否修改？（修改后无法撤销）");
        if (c) {
            stupidAjaxGetJson("/adm/uploadProject/" + uploadId, "PUT", {result: '通过'}, function (data) {
                alert(data.msg);
                if (data.success) {
                    $("#result" + uploadId).html("通过");
                }
            });
        }
    }

    var changeView = function (n) {
        if (studentId !== null) {
            selectView("/adm/uploadProject/?pageNum=" + n + "&keyword=" + "${keyword!''}" + "&studentId=" + studentId, "学生${studentNum!''}上传管理");
        } else {
            selectView("/adm/uploadProject/?pageNum=" + n + "&keyword=" + "${keyword!''}", "学生上传管理");
        }
    };
</script>
<script type="text/javascript">
    generateKK(${pageBean.pageNum}, ${pageBean.pageCount}, ${pageBean.rowCount});
</script>